﻿/// <reference path="_namespace.js" />
/// <reference path="../collections/ArrayList.js" />
/// <reference path="GameComponent.js"/>
/*****************************************************************************
Ajaxna library class definition. Inheriting from ajax.xna.GameComponent.
Author: krobinson 10/7/2008 11:48:29 AM.
Class:  ajax.xna.SpriteLayer
*****************************************************************************/

$addNamespace("ajax.xna");
$imports("ajax.collections.ArrayList");

//-----------------------------------------------------------------------------

ajax.xna.SpriteLayer = function(game)
{
    ajax.xna.SpriteLayer.superConstructor.call(this, game);   
}
$extend("ajax.xna.SpriteLayer", "ajax.xna.GameComponent");
if ($getDesignMode())
    ajax.xna.SpriteLayer.prototype = ajax.xna.GameComponent.prototype;
//-----------------------------------------------------------------------------

// Public members
//-----------------------------------------------------------------------------
ajax.xna.SpriteLayer.prototype._sprites = null; if ($getDesignMode()) ajax.xna.SpriteLayer.prototype._sprites = ajax.collections.ArrayList.prototype;

ajax.xna.SpriteLayer.prototype.get_sprites = function() 
{///<returns type="ajax.collections.ArrayList"/>
    if (this._sprites == null)
        this._sprites = new ajax.collections.ArrayList(this.getDocument());
    return this._sprites;
}

// Public Methods
//-----------------------------------------------------------------------------
ajax.xna.SpriteLayer.prototype.initialize = function()
{           
    ajax.xna.SpriteLayer.superClass.initialize.call(this);
    //TODO: Add your initialization code here.    
}

ajax.xna.SpriteLayer.prototype.update = function(gameTime)
{     
    gameTime = ajax.drawing.Timer.cast(gameTime);
    //TODO: Add your update code here
    
    // call update on all our sprites...
}

/* TODO: Uncomment for DrawableGameComponents
ajax.xna.SpriteLayer.prototype.draw = function(gameTime)
{
    gameTime = ajax.drawing.Timer.cast(gameTime);
    //TODO: Add your draw code here
}
*/

// Statics
//-----------------------------------------------------------------------------
ajax.xna.SpriteLayer.cast = function(obj)
{///<returns type="ajax.xna.SpriteLayer"/>
    return obj;
}